From e51fd7cb18cd1c74d41f11337257b2faa7b250d2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 6 Sep 2016 06:37:47 -0400 Subject: [PATCH] css: Complete the cross-fade implementation We need to actually compute the images. Otherwise, bad things happen when we try to draw. https://bugzilla.gnome.org/show_bug.cgi?id=767391 --- gtk/gtkcssimagecrossfade.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gtk/gtkcssimagecrossfade.c b/gtk/gtkcssimagecrossfade.c index 812457995a..bb631a4075 100644 --- a/gtk/gtkcssimagecrossfade.c +++ b/gtk/gtkcssimagecrossfade.c @@ -227,6 +227,27 @@ gtk_css_image_cross_fade_print (GtkCssImage *image, g_string_append (string, ")"); } +static GtkCssImage * +gtk_css_image_cross_fade_compute (GtkCssImage *image, + guint property_id, + GtkStyleProviderPrivate *provider, + GtkCssStyle *style, + GtkCssStyle *parent_style) +{ + GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image); + GtkCssImage *start, *end, *computed; + + start = _gtk_css_image_compute (cross_fade->start, property_id, provider, style, parent_style); + end = _gtk_css_image_compute (cross_fade->end, property_id, provider, style, parent_style); + + computed = _gtk_css_image_cross_fade_new (start, end, cross_fade->progress); + + g_object_unref (start); + g_object_unref (end); + + return computed; +} + static void gtk_css_image_cross_fade_dispose (GObject *object) { @@ -250,6 +271,7 @@ _gtk_css_image_cross_fade_class_init (GtkCssImageCrossFadeClass *klass) image_class->draw = gtk_css_image_cross_fade_draw; image_class->parse = gtk_css_image_cross_fade_parse; image_class->print = gtk_css_image_cross_fade_print; + image_class->compute = gtk_css_image_cross_fade_compute; object_class->dispose = gtk_css_image_cross_fade_dispose; } -- 2.30.2